package com.ngc.mall.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ngc.mall.common.configure.mybatisPlus.BaseServiceImpl;
import com.ngc.mall.domain.EmployeeDomain;
import com.ngc.mall.mapper.EmployeeMapper;
import com.ngc.mall.service.IEmployeeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * 员工实现类
 * @author: chenxiaolin
 * @date 2023/9/20 18:19
**/
@Service
public class EmployeeServiceImpl extends BaseServiceImpl<EmployeeMapper, EmployeeDomain> implements IEmployeeService {
    @Override
    public Long createEmployee(EmployeeDomain employeeDomain) {
        return super.create(employeeDomain);
    }

    @Override
    public List<EmployeeDomain> selectAll() {
        return super.list();
    }

    @Override
    public Boolean updateEmployeeById(Long id, EmployeeDomain employeeDomain) {
        return super.update(employeeDomain, Wrappers.<EmployeeDomain>lambdaQuery().eq(EmployeeDomain::getId,id));
    }
}
